package j_graphics;
// 선의 굵기와 색깔 지정

import java.awt.*;
import java.awt.event.*;

class MyDrawLine extends Frame
{
	Panel panel =new Panel();
	Graphics2D g2;
	public MyDrawLine()
	{
		setSize(300,300);
		setTitle("Graphics");
		add(panel);
	}
	
	public void paint(Graphics g)
	{
		draw();
	}
	
	public void draw()
	{
		Graphics g = panel.getGraphics();
		BasicStroke bs= new BasicStroke(2);
		g2 = (Graphics2D)g;
		
		g2.setStroke(bs);
		g2.setColor(Color.blue);
		g2.drawRect(50,50,100,100);
		//g2.drawLine(50,50,150,150);
		//g2.drawLine(150,50,50,150);
		repaint();
		
	}
	public static void main(String args[])
	{
		MyDrawLine f=new MyDrawLine();
		f.setVisible(true);
	}
}